change encodeFilename to lowercase