fix core dump bug