Fixing bug with determining count of slides to slide