Chat manager

fixes double free on window close, hang on sending chat messages