Aere you talking about moss flies ? They breed in the compost, especially but not exclusively where sphagnum is used. If so - or if they breed in the compost whatever you call them, then adding a general purpose disinfectant ( Physan - see my post on the "Fungus problem" thread currently running, as a side issue !) - is your answer. Just use in the water, maybe at 1:1000 the first time - but try reading the label first !!! - as a complete dunk, get rid of all air - then afterwards at 1:5000. Strong enough to be a deterrent, keeps everything sweet and clean..