fix database read setup bug