fixed multiple queries issue