improved isDataValid function for GPS strings