add javascript to improve carousel autoplay