changed scrollPositionEnd calculation for scrolling in containers