add a sample and fix some bug