fix multiple call of connect to return if connection is already established