how to pull new element added to an array?