fix encryption method