Changing event name to beforeScrollEnd