Fix getHistory TypeError