fix errhandler