Fix switching issue of viewing histories.