fixed bug in infinite scroll and switched to events