changed domain to request.endpoint to make it automatic