applying updates in order and preventing races