fix bug in query grammer.