fix a bug with decrypt