fix redundant array creation