Unable to convert NaN to a number - found segment of code responsible but still can't debug

Does this help?