It it's green, it's probably an algae bloom which is not dangerous for your fish. If it's just cloudy, then it's probably a bacterial bloom which sometimes happens when you clean your tank. How often do you feed your fish, and what is your maintenance routine? Do you vacuum your gravel and how often? How often do you do a water change? Answers to these questions could all be indicators to why you are having problems.
Glad you solved the problem. If you weren't able to clean your filter in old tank water and throw the filter media away, be prepared for at least a minI cycle. Your water may get cloudy again if you have a bacterial bloom.