added back in statechange switch case