fix validate bugs