Added checks for scroll heights