samples size check bug fixed