Trying to install a ceiling fan with a light. The ceiling box had 2 sets of wires. One set has a black and a white wire where the other has black, white and red wires. I connected the black from the 3 wires to the white from the two and then aligned the rest with same color (except red went with blue). Light works with switch but fan stays on but can be turned off with only the cord. What did I do wrong and is it dangerous to leave as is? Thanks!