fixed a null pointer exception on the sampleSize array