strange error with outfile.close() ???