fix database connect