fix missing global $DB in validation