error to function