add geometry check and remove alter geom type (not needed)