undefined error at the end of audio recording fixed