yeah there must be a if (!headerfile) then return after fopen but also we need this before fclose checking