add history handler