Add onMessage event.