update generate id method