updated import code to consider NAs