replace NAs and compared