adding a few assertNotNull checks