Set the correct state of the variable.