Dryer won't turn off but advances through all cycles

My dryer heats fine but will not turn off. It advances through all the cycles and keeps going past all the Stops. The only way to turn it off is to open the door. Anyone know what part needs to be replaced?