make query work