Problem isn't the trying to reset the variable. Single = in most all programming languages is specifically reserved for setting variables. You need == to test if they are equal to something.