added plaintext support