fix missing variable index