fixed horizontal and vertical movement bug