add example and fix a bug