use handler to register history