Fixed the crash bug.