fix small bug with encryption