take in query as arg