tried to implemt the validation