This is probably a silly suggestion,but I can't see any errors in your code :

Have you tried to lower down the value "+= 10*time;" or wait longer than "wait 1",
perhaps it's working, but you can't see it...