Fix the crash bug