fix bug if there are fewer events than the subsample count