Fix the bug that assign None to the dict.