[TW213] Updated qc with some checks and changed query