Add error handling to resolve