Working on implementation of the publishmessage