fix mem leak in example