fix crash when show diagnostic