fixed file type check bug