Fix execute case when query error is found