race condition between dom update and sort