better error message formatting