Fixed that it only closes and fills the polygon at the end