Add counter for total failed queries