fixed python 3 dict keys issue in history