fix bug - inconsistent temp ID when saving a new object