setting endpoint done properly

not tested for bugs yet