fix bug in printing fh instead of filename