bug fix: unexpected error causes sigseg