fixed crash, moved joinchat and leavechat