gracefully handle crashes