fixed a bug on the queryTempView() method