add example and fixed some bugs