Solving id updating issue with dynamic tables.