fix error in criterion add/delete causing invalid write file