updated reset function in JS file