added error callback in stopRecording method