moved stream handler here so that hooks can send output to tsuru