Resets the state