Fixing autoplay bug & onBeforeChange