fixed checking states condition if the state is undefined
v0.4.3