gateway: also set (update) the gateway when costs have changed