Added Undo/Redo management & deleting commands when new command after undoing