Adding where class, try making an extension of the query class.