some versions don't have fs.exists, so use path.exists instead