change to regist hook