corrected array de-referencing