fixed invalid id to generate when save