Patch 2

close($handle); changed to  fclose($handle);