Fix the crash caused by auto generating id.

Signed-off-by: cyberzhg <cyberzhg@gmail.com>