fix bug with duplicate rows in df that have NA value