updated to check for non-strings