fix a encryption bug