adding function errors