fix wrong stdout and stderr