fix the crash bug