Fix initQuery() bug

Change-Id: I4aceee6a08742eaa82aaeec7514ff1db2fdee211