fix bug with stdout