better handling of crashes or unexpected exits