added options.onReachEnd and options.onReachBeginning