Fixing checking substrings