improving error handling: adding stdout to error message