Added logic of updating the files