allow passing of file handles