Adding correct validation code