make ciw and diw work correctly