add better error detection to hugefiles