Are you sure? Shouldn't be an `else` part, to actually close the connection if the connection is indeed connected?