add examples and fix a newly instroduced bug