fix dynamic constant assignment
fix invalid error class
use the encryption logger