set state to 0 on exit