For those who use dirt or leaf litter mixes as their substrate, how do you keep the habitat from becoming a gnat breeding ground?

I'd very much like to switch over to this substrate for my juve salvator, but my past experiences with other monitors has resulted in a bazillion flying biters in the enclosure each time.

Thanks!