fix some bugs for examples