retain the close events outside the https condition