fix bugs from xiaowu