Fix error handling error