adding option to close open handle