correct bug on number of samples bounds