try to catch and resume from unexpected shutdowns