Add example and fix bug