fixed the bug in conditional imputation