trying to fix decryption bugs with read