fix double query execution issue