Fix on set_endpoints method