undo and redo working for move