Another hotfix for last id and last table