fix multiple query problem