fix NA generation for invalid entries