added some logging to shutdown process.