deal with multiple gateways