Adding the undo for rotation.