Fix the bug that can close necessary modules