fix scrolling at end of buffer