This question was answered, but it brought up a question about how to catch the InvalidArgumentException, which I added in the Update section.