changed undo method

note: need to update parser