cleanup of shutdown process