fix bug with state2