Setting initial state of state machine.