Removed the deprecated usage of writeStringToFile