test fclose loop