Solves issue #880 when clicking on the next slide button

This actually solves the issue.
Although I'm not sure if this is the correct way to solve it, I just needed a quick fix for my project and it seems to be working fine.

Haven't done any extensive testing.