fix bugs in movement