added `diag.na` argument