Added logic to ensure that objects in `set` exist