implemented undo and redo sidebar buttons to do undo and redo directly