fixed bug with UNDO REDO