Temporary fix of the ENOENT bug when updating a existing file. Needs to be redone because fs.exists() is deprecated.