add validate class function