fixes for potential segmentation faults

fixes segmentation fault for 1 audio file