An error occurred: cannot convert float NaN to integer