Laptop Turns on when lid is closed and sleeps when the lid is open
I am having a problem with my laptop. I usually close the lid to put it to sleep but recently (Since swapping out the optical drive and putting a new hard drive in) when I close the lid the laptop will fall asleep than wake up. I can hear the disc spinning and the laptop becomes hot. Also whenI open the lid in this state the computer will revert back to sleeping and will not wake up.
How can I fix this? The only thing I have attached via blue tooth or hardware are headphones and the charger.
MacBook Pro, Model A1226