fix recovery from crash