fix saving wav file