geocoding function optimization and fixed duplicate rows insert problem