working in the query creation