race condifiton fixes added to polylines