implementing file renaming after read operation