Reads history file properly