if it was indeed necessary for jamie to be released from prison , in order to prevent the jacobite invasion of scotland , then it seemed that i would have to do the releasing , whatever the method , and whatever its consequences .