fixed bug in sample