Better history handling between sessions