Error correction on query status variable