added cap to scroll distance