problem with closed filehandles