Added a check for no slides