Add more error handling.