Added logging of crashes in the database