if (state == 2) state = 1