It can often be caused by too much phospate. Plants need phoshate but if you make sure there is plenty of light, carbon, nitrate and micronutrients then the plants will take off and minimise the phosphate. Many sites suggest adding nitrate to get the balance better but I think making sure that phoshate is the limited factor in all the requirements is the safest. If you don't get the balance right it will come back even after you kill it with antibiotics. I lost a load of fish once by dosing with E. as It killed the bugs in the system and ended up with ammonia poisoning. I had used it previously without problems. Also if you cut out the lights you will still get it back if you don't get to the initial cause.