fix bug in moving