replaced stubs for stdout and stderr