fixed bug where decode_text failed to handle exceptions correctly