added chat and logout functionality on controller level