better method of changing animation duration and scrollToEnd