add function of saving file to local storage