Count adn union tables bug fixed