I think this logic needs to be flipped, because valid inputs end up throwing the exception