fixed initialization bug where instance ID is not saved correctly.