prevent arraylist resize from affecting state matching