mutex changes for shutdown