fix the return of the errors