added closehandler