minor bug fix for add sample