need patch to inst->session_tail clear ?