check the string instead of slice