Update main.js

Issue when asking multiple for the total amount of records it was adding them all without resetting the variable (duh).