making strings more robust when encountering string files with empty lines