fix some validate bugs