improving order of initialization for editor
fixing way editor is shut down