unclean shutdown resilience (final part of the fix)