undo redo bug fix..