maytag oven will not maintain temp

having a intermitting problem with oven. the oven will not maintain the set temperature. the oven will turn on and it appears it preheats to set temperature,but it will not maintain set temp for desired cooking time and food will not be cooked. i replaced the oven sensor and still experiencing the same problem. it seems if you turn the oven off and then back on, it sometimes works properly. thankyou