Fixed some missing code and chat now works