Added callback for onMessage