Adding filtering to the query