Correct variable in union()

Correct $geos to $geom in union()