better header check file generation