added functionality to catch scrolling