add validate funct