added missing fclose() to free the handle after a test run