Use cidfile correctly