fix invalid encoding issues in filenames and move to thin