added checks to determine the state type