better handling of potential errors in wkt strings