improved isFinite()