fix write-polys