adding check for if the the checkbox is null (false)