Intellij might close project before files and vice versa. Must add check to close all editors.