fix some SIGSEV