fix some encryption issues