resetting the state when it restarts