create resetScroll function