add example and bug fixed