fixing issue where the wrong route was being used for the /query