fixed issue when using editor.destroy