fix bug in state3