session key encryption bugfix