added forgotten ssl_closed logic