Oven Won't stay light or stay lit, Igniter is working

I have a Frigidaire FGF337AUA and the oven will light but does not stay lit or has a very weak flame. The igniter is fine. It will light sometimes and when it has a weak flame, if I open and slam the door, the flame works normal for a little while. I was thinking it was the temperature sensor because the flame sometimes goes out completely and I can smell gas. Would the temputature sensor going bad cause this? The rest of the oven works fine the top burners and electronics (clock, timer) are all working. Any help would be much appreciated. Thanks in advance.