array index corrected