Fixing index
Handling increase of id smarter