fix database reader bug