fix loop for parsing hyphenated words