added logic to check that destination file is identical to the source file