Fixing the infinite scrollbar bug