fix possible sigsev