ticket:38 fix NPE and audio recording bugs