adding throw_if_error