fix unreferenced handlescope close