construct mode with session, not document