Fixed bug in autoplay