Making sure only the latest version of file is copied