modified by jack for receiving the message