fixed error in picking the parameters to sample