The white worms your are referring to may be the mushrooms intestines, mesenterial filaments? They project them out thru their mouth when they are not happy with their present condition.
I find they do it most often due to water parameters mostly, but lighting, another coral agitating them, are too strong of flow can cause it too.