added filtering to view query