Another fix for setup_endpoint