Fixed undo not working for delete