clean function validate