if it is melting it means it is dieing/dead...
to prevent it, you can make sure you ahve good water quality, it is being fed enough, you have the proper lighting, nothign is harming it, etc.
If it is melting and you are not VERY experienced in SW/coral care I would remove it, at this boint it will only polute your tank. Sorry to say so but sometimes the truth hurts.
a good ball of either chaeto or caulerpra, in a low flow area of the tank is always going to be a bonus for you in helping to reduced nitrates and or phosphates..