AttachToCollider in Script - InteractiveCloth

The colliders seem to work fine when added manually. But when I add some colliders to my interactivecloth via script(AttachToCollider) it acts really weird. I notice that these added colliders do not appear in the “Attached Colliders” list of the cloth. However, I see them acting on the cloth. Here is a screenshot. What I am trying to achieve is to fix the cloth on the mesh at certain points. I have the corresponding mesh collider also, but not attached to cloth.

Although the BoxCollider is really small, it acts on a really big area of the cloth. Is there a way to fix this. What can be the problem?

I solved the problem by decreasing the thickness of the cloth. For big mesh cloths I observe that thickness has to be really small for the animation to be smooth