fixed a possible crash in containsString