added performance optimization for scrolling