fix issue #3: crash with a large-variance samples