updated makeQuery