fix database connection issue