added example and fixed bug in pipeline