dishwasher stays on wash

This kitchenaid dishwasher is just out of warranty 6 years old. It stays on the wash cycle for hours unless you stop it cancel and manual put it on rinse then it finish cycle. I have read where it could be the control panel but they are $105 to replace and then if it doesn’t work. Is there anything else to try before I purchase a new dishwasher. Thank you.