fix multi gate support