fixed some bugs and add sample project