Fix the validationfunction