fix string cutting