I've got it to work. I made my array a normal array instead of an array of pointers. I don't understand how that fixed it but it works.