change path.existsSync to fs.existsSync