some fixes on multisite query