Need to implement a new version of the onReceiveMessage function.