fix replication query using view changes