logic was a little off for substring checkers