small bug relative to gates