added isset test to UnitOfWork to prevent notices