File IO fix