Fixed up change-state code to similar to what it was before