Added method to execute input string query