Modifying the array of a repeat element on button click