core shutdown process updated.
more work on shutdown.