The gate and the initial foreach loop are unnecessary. Try adding a foreach loop after each on clicked event, like I have done in the picture below. I was able to get this to work without issue. Let me know how it works out.