App crashes to previous activity


Hello, I am making a math puzzle game and I need some help. So, basically my app swaps pictures (the math problems) and the user has to write the answers. In the current build of my app going from the 1st all the way to the 40th problem is fine, but going (swapping pictures) to the 41st (note: the 41st is my last problem so there isn't a 42nd) "crashes" the app to the previous activity (the menu). I checked and I am pretty sure that all my arrays/lists are of size larger than 41. Anyone know what could be the issue? Thanks for your time.