fixed a bug when encoding non salted