work-around lack of writeheader in 2.6