implemented logout functionality
now messages can be posted successfully