better error message for debugging