fix crash on editor