UDIM Mask method using IF statement Stops working after 4th tile

I have discoved the UVs were flipped somehow in the UV map for the vertices in tile 1011.
Putting an 1-x node after tex coord has solved the issue but I will go back into editor and Fix the vertices in the UV later. So this material can be reused.