fixed #27, switched to a local variable in populateSlides