remove this if/else block and use `utils.getFile(targetFolder, targetName)` to join folder and filename with OS file separator.