switching to CURL instead of fopen