FIX: flush session data earlier in finalize