Started working on state recovery/clean shutdown