Auto dryer setting not working

I have a gas dryer which works in in the timer mode, but in auto cycle, no heat and the dryer continues to run. The duct is clear and the machine is free of lint. Do I need to replace the thermostat or is there something else to replace?