added QueryTemplate try catch statement, catching empty result