finish history functions.