fixed up SIGSEGV when missing if or else block