implemented undo on command pattern