add three or more gateways support