added share_only flag and corrected some bugs with deleting instances and such