fixed termination problem once an ssl connection was established