fixed the bug that breaks the slideshow