A lot times contractors will run power thru the black wire to the switch and will return power from the switch on the white wire to a junction box where the wires from other lights have been ran. Saves them money by using less wire. Check to see if one of the white wires has black paint or black tape on them. It is supposed to be black paint. This is the wire that comes from another switch and should not be hooked up with the rest of the white wires. It is hot, it has power on it!