closes #43. Added check for state initiation before performing operations on the state.