fixing local endpoint so it can run as a service