fixed bug when adding empty samples