Added check before adding new state