better error messages for the generic functions