array elem setting bug