fix database exception