implemented undo button