fixing slideshow bug