Added validation code