add checkQual code