fixed idnum generation