basic impl of validation