Did the error that came with the exception show a location of where in the main is this exception being thrown?

I have a hard time following your code, but thought I might have noticed something...