fixed idGenerator to actually work as intended