change code logic : wait fo all queries completion