Shoes sole using Twisted box consecutive

Hi everyone!

I’m trying to create a shoe sole using the surface that I made and then using the twisted box consecutive to make the boxes follow the surface.

However I’m having this problem, where the box created by twisted box goes over the surface making a rectangle and not following only the form of the surface