Add sample project fix some bugs