fixes bug when setting endpoint using a full path