Fixed bug: hasEndpoint should be hasEndpointString