attempt to improve
fix sample.add regression test