fix the encry bug