Added undo behaviour