endPoint undefined fixed