fix bug with file rename when PK changes