dirty hack for stdout buffer