A bit of a hack to get exit working...