fixed crash when closing editor