Fixed missed on occurence of number of samples