register events.