major modifications on rename detrection