fixed add_instance.