fixed ibd qc script