fix encrypted history speed

May or may not fix related issues