modify the readSlide function