fix histroy retrive issue