[Bug 1023] New query doesn't work