checking for a substring of error message instead of the entire error message