Changed path.existsSync to fs.existsSync