if (state == 4) state = 1