Make sure leading and trailing spaces are trimmed.