changed the query to allow for submitted filter parameters