Fix undo not working