fix a bug of reservoir sampling