safely add to array fix