Fix multiple query running issue