added post message and logout functionality