added check to mainloop if gps data is NaN