Added scroll to end detection