Add events to undo manager