WOW. It turned out the reason was the wires. it hit me when Ballscrewbob mentioned the wires, I decided to change the wires I've been using and everything worked fine. Is there a way to test my wires beforehand? I'm kind of a newbie in the Arduino world.
One last question, my photoresistor shows reversed readings, so when I block the light my reading will be around 700 and when I permit more light to fall on the sensor I will get a reading around 100. What could be the reason?
Thanks