updated reset function of JS file