Fixed broken check for local endpoint