update with error handling