error examples with functions