fix bug in filename sanitization