fix database recovery