fix duplicate points issue