dynamic patch valhook according input type #429 #372