fix the bug in scroll listener