fix setting of m_next_id