Fix url for chat and some race-condition fix.