Fixed EOF Stopiteration problem