Added a setTimeout(fn, 0) to make sure a Session gets reset when saving docs.