added get_gateway_fields function