Query contcatenation fixed