fixed end of string problem