fix bug in sample stats