return an error if create/update failed