Added the undo button function