switching to fopen