minor improvement of function to check for string suffix