get rid of memory leak in example