Added OnMessage handling