Modified so that the state is set to active