fixed out of bounds error in explode