Fixed error when string query is not defined