added error handling for non-encrypted data over encrypted channel