added check in case stop() is called without a valid connection being present