Attempt to fix validation code