attempt 2: fix NA problem