Add a stop recording function.