modify register_handler