fix crash issues