new scroll function, improve performance