implemented prototype for validation
minor fixes`