fixed updateEndpoints method