Fix a crash bug