added error handling if iflat is not a field (when we use polylines)