use previous with state_changed?