more robust I/O filehandles