elements access in arrays fix error