added extra logging and extra check for file rename