added closeHandle method