use pclose, not fclose