Rework bad logic with id change