fix sudden exit?