automatic database repair on startup