fix updating the position