move the queryUrl variable into the getURL method