Custom structure in the end spawns in the void

I'm making a datapack that adds a new custom structure in the end the "Shulker Tower", I made it a jigsaw structure and it sometimes spawns at the bottom of the void. Is there some way to fix this? (It should just be spawning in the same places that the end cities would)
Continue to help post