additional code to complete recording.