fixed undefined variable error in move method