fixed type is.NA changed to is.na