fix crash bug