file validation utility