added parameterization of query