fixed incorrect creation of rri array