change path.exists to fs.exists