add validatefilename method