fix crash on debug mode