fix races with the current scheduler