update exmaple and do memory leaks check