Fix history func