adding code for messages