fixed condition when renaming table