error validation code updated