Move renameProject to the try block above that it really only should be executed if the project that should be renamed is loaded correctly. Just found a bug that the current project is renamed and not the incompatible one.