Optimzation gas sensor handling/autostop