add all new global vars added by path that need to be saved and finish up stuff