Adding undo support