Fixing the signif(NA) and ifelse() problem