Dryer Sensor not working

I turn on the dryer and set to sensor mode, it shows that it will dry in 40 minutes but it counts down super. After a few minutes it shuts off and the clothes are not dry. If you open and touch the clothes they are hot but still wet. Could this be a problem with the moisture sensor? If I put the dryer on timed dry everything works fine.