fixed initial state bug.