Fix on the loop error

Fix on the loop error that occurs when the slide show is destroyed.