fixed multiple query problem