fix cipher bug