bug fix on scroll event