Adjust error handling