added isset test to UnitOfWork to prevent notices

When working with the Mogo ODM I kept getting notices about an index not being present.

This fix adds a simple isset test to prevent these notices occuring