Maytag Dishwasher stuck on wash cycle

[SIZE=3]The dishwasher gets stuck on the wash cycle. Dishes are cleaned, water drained, the dishwasher just keeps humming and won’t switch to"dry" cycle. It does not happen every time I use the dishwasher. I can turn the dishwasher off (canceling) and let the dishes air dry. Sometimes, if I open and close the door a few times, it switches to the dry cycle. Any help would be appreciated. Thanks![/SIZE]