91 3.0

1991 Nissan Maxima

I have a 91 nissan maxima engine 3.0 automatic transmission, when I drive the car for 15-20 minutes and make a stop the car turns off if I put the car in park or neutral the car starts but as soon as I put the car in reverse or drive the car turns off