update the function of adding file