added stdout control