Oven trouble

My oven was taking several minutes to heat up. I replaced the igniter and now the igniter lights, gas is coming out and it still won’t light. It lights up using a match but when the oven gets a certain degree it shuts off and won’t light up again and I smell gas. Could it be the valve?