update query filter function