only set endpoint if defined