Fixed counting the incoming messages in the listener in the test