Update main.js to fix COUNT issue