Add error handling if resource is not available.