Got the message function working well