fixed invalid move bug