Updated to clone the array