Add error handling.