safety guard for db destroy