Added except handling to IndexError for when you run out of data to read.