Fixed mistake in getting network from db