fixed polygon bug