fixed stdout/err processing on app error