fix crash on editing