fixed Substring search issue