code added to avoid unnecessary crash while using navigation using mobile data.