oops was returning wrong var in query