fixed a bug on queryView()