modified ProjectCreator.replaceFile()