Fix the bug of IndexOutOfBound when clicking History header row