fixed bug in EOF for data file