FIX: get first key from gateways list, rather than first value.