Not selecting endpoint when coming from url