When a match is found, the matched shape needs to be removed from the shape list. The app was crashing when the first shape in the list was the first to be removed from the list. I moved the code to remove the shape from the list to outside the for loop to prevent the crash.