changed scrollPositionEnd calculation for container scrolling