bug in updateGravity