fix signal handler crash bug