Fixed id generation algorithm to prevent generate same id when control's id is identical