fix state handler