added error message wrapping