fix cursor position when scrolled down