Added null checker before setting value of service when getting location data