fix example code
(cherry picked from commit d64a148)