handle terminated gc context

closes #507