added additional nil checks

missing a few nil checks