Chat bug fixed

Chat bug: str.length() is not a function, it is propery str.length