work intermittently

maytag dishwasher works only after opening and closing door several times is this a door latch problem or control board or other? thanks for any help.