backported carousel js fix