undo button works perfectly now