added fileNameCheck and tests