Stop scrolling when top or bottom is reached