Amana Dryer - Won't stop when door opens

The main problem was seen when the clothes were dry, the dryer did not stop, but continued to run. I then opened the door and it just kept on running. I had to turn the control knob to an off position to make it stop rotating. Any help would be very helpful. Thanks, John