added encryption support