fix some bugs and add search example