fixed NAN not defined on older systems problem