Update ChatFilter.java

optimization and a little bug fixin