Fix history bug