Whirlpool oven keeps turning off

My oven turns on when you start to preheat but you will hear the gas turn off in a few minutes, then the oven will tick-tic-tic-tic- poof flame on. I do not understand why the oven keeps turning off. Is there a flame sensor that may be the problem?
Thanks
dUG