Project 09 (Motorized Pinwheel) problem - motor spins forever

I tried using pin 8 instead of pin 9 and it worked!
I think it could be a problem in using PWM pin 9...
Another solution could be to use analogWrite(9,255) instead of digitalWrite(9,HIGH) and analogWrite(9,0) instead of digitalWrite(9,LOW).