Why won't a material change more than once?

I am currently developing a code breaker style of game. I have four grid slots which are filled in with four shapes of various colors to try and solve the code. Once all four slots are filled, the “solution” function runs. If both shape and color are correct, the slot turns green, if only one or the other is correct, it turns yellow, and if both are wrong, it turns red. Then the user can hit a button to retry a second guess. Upon reset, the slots all turn back to white, and they can enter a second guess at the code. This part works.

Now, if the four slots are once again all four filled in, the solution runs again. The problem is, the material change to determine if the code is correct or not does not occur. However, I attached a print string to each solution “check,” and it outputs that it is indeed checking the solution. The only thing that isn’t occurring is the material change on the slots.

Here is my set up for the solution check:

The four materials are in an array (default at 0, green at 1, yellow at 2, and red at 3). It changes the first time through, and changes back to white when you hit reset. However, it doesn’t change again after that. Any ideas how to make this work?

Here are some shots of what happens when tested:

This is guess one’s solution:

And this is what it does on checking the solution for guess 2: