modified random array generation in order to fix issue