add a new text file to store application state, if there is an error in running, record the state to restart the app to continue get data instead of getting data from start