redirect stdout for debug