checks for nil