revise the get random array method