adding nil guards