added check for stop recording bag