fixed small error in move logic