bug fixes and scroll logic