fix unchecked fopen call