fixed file validation bug