Bug fixed when location data is null