added function to check for substring.