fix encrypt bug