changed endPath to closePath