add header checking
fix file name checking not taking into account path before file name