Another fix for cast exception in geofence