avoid isnan() for pre-iOS 6 deployment