fix bug, to pass query correctly