acounts for special character at end of string