fix gatewaysII