add check for NaN to generatedf method