Added conditional for encrypted_type