Revert "gates fix attempt 2"

This reverts commit 819274c06098ab7a479b65d60f250a270203dddd.