added validation, still working onecn functionality