changed state= to set_state since there are more usages of state=