don't forget beginPath() before <polyline> and <polygon>