fixing some bugs and code cleanup related the chat browser client