fix bug in random_vector

fix bug in random_vector